﻿using ClumsyWordsPortableLibrary.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace ClumsyWordsWP8
{
    class PartOfSpeechConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            switch (value.ToString().ToLower())
            {
                case "noun": return PartOfSpeech.noun;
                case "pronoun": return PartOfSpeech.pronoun;
                case "adj": return PartOfSpeech.adjective;
                case "adverb": return PartOfSpeech.adverb;
                case "verb": return PartOfSpeech.verb;
                case "preposition": return PartOfSpeech.preposition;
                case "conjunctoin": return PartOfSpeech.conjunction;
                case "interjection": return PartOfSpeech.interjection;
                default: return PartOfSpeech.unidentified;
            }
        }
    }
}
